import { createStore } from 'vuex'
import { setTheme } from "@/theme/changeTheme"

export default createStore({
  state: {
    theme: localStorage.getItem('theme') || 'dark',
    colors: JSON.parse(localStorage.getItem('colors')),
    provinceId: '370000',
    proCityId:'',
    proCityIdName:'',
    hefengCityNo: '101120511',
    highlightCityNameOld: '',
    highlightCityNameNow: '山东省',
    highlightShengCityNameOld: '',
    highlightShengCityNameNow: '琼海市',
    htmlScale: 1,
    morethan1Shengs:["海南省"]
  },
  getters: {
  },
  mutations: {
    setThemeStore(state, theme) {
      setTheme(theme);
    },
    setColorsStore(state) {
      state.colors = JSON.parse(localStorage.getItem('colors'))
    },
    setProIdStore(state, provinceId){
      state.provinceId = provinceId
    },
    setProCityId(state, proCityId){
      state.proCityId = proCityId;
    },
    setProCityIdName(state, proCityIdName){
      state.proCityIdName = proCityIdName;
    },
    setHFCityNoStore(state, hefengCityNo){
      state.hefengCityNo = hefengCityNo
    },
    setHighlightCityNameStore(state, highlightCityName){
      state.highlightCityNameOld = state.highlightCityNameNow;
      state.highlightCityNameNow = highlightCityName;
    },
    sethighlightShengCityNameStore(state, highlightCityName){
      state.highlightShengCityNameOld = state.highlightShengCityNameNow;
      state.highlightShengCityNameNow = highlightCityName;
    },
    setHtmlScaleStore(state, htmlScale){
      state.htmlScale = htmlScale;
    },
  },
  actions: {
  },
  modules: {
  }
})
